package com.assetmanage.service;

import java.io.InputStream;
import java.util.List;

public interface MinioService {
    /**
     * 文件信息类
     */
    class FileInfo {
        private String fileName;
        private long size;
        private String uploadTime;

        public FileInfo(String fileName, long size, String uploadTime) {
            this.fileName = fileName;
            this.size = size;
            this.uploadTime = uploadTime;
        }

        public String getFileName() {
            return fileName;
        }

        public void setFileName(String fileName) {
            this.fileName = fileName;
        }

        public long getSize() {
            return size;
        }

        public void setSize(long size) {
            this.size = size;
        }

        public String getUploadTime() {
            return uploadTime;
        }

        public void setUploadTime(String uploadTime) {
            this.uploadTime = uploadTime;
        }
    }

    /**
     * 获取文件列表
     * @return 文件信息列表
     */
    List<FileInfo> listFiles() throws Exception;

    /**
     * 上传文件
     * @param fileName 文件名
     * @param inputStream 文件输入流
     * @param contentType 文件类型
     * @return 文件访问URL
     */
    String uploadFile(String fileName, InputStream inputStream, String contentType) throws Exception;

    /**
     * 下载文件
     * @param fileName 文件名
     * @return 文件输入流
     */
    InputStream downloadFile(String fileName) throws Exception;

    /**
     * 删除文件
     * @param fileName 文件名
     */
    void deleteFile(String fileName) throws Exception;

    /**
     * 获取文件访问URL
     * @param fileName 文件名
     * @return 文件访问URL
     */
    String getFileUrl(String fileName) throws Exception;
} 